'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {
	// 把传过来的对象取出id
	let {
		_id
	} = event.datas
	let dbName = event.dbName
	// 删除对象里面的id属性，因为不能修改id
	delete event.datas._id
	// 执行修改的jql语句
	let result = await db.collection(dbName).doc(_id).update(event.datas)
	//返回修改后的结果
	if (result.updated == 1) {
		return {
			status: 0
		}
	} else {
		return {
			status: 1
		}
	}
};